package org.HisCanvas.ChrisRiffle.JFlightLog.swingUi.graphPanel;

import java.awt.Color;
import java.awt.Dimension;


/**
 * 
 * GraphPanelController
 * 
 * @author rif 
 */
public class GraphPanelController {
	
	
	private LogBookGraphPanel graphPanel;
		
	
	private static GraphPanelController INSTANCE;
	
	
	private static final Dimension GRAPH_PANEL_SIZE = new Dimension(500,300);
	
	/**
	 * singleton enforcement
	 */
	private GraphPanelController() {
	}
	

	/**
	 * singleton
	 * @return
	 */
	public static GraphPanelController instance() {
		
		if(INSTANCE == null){
			
			INSTANCE = new GraphPanelController();
		}
		return INSTANCE;

	}

	
	/**
	 * getGraphPanel
	 * @return
	 */
	public LogBookGraphPanel getGraphPanel(){
		
		if(graphPanel == null){
			
			graphPanel = new LogBookGraphPanel();
			graphPanel.setPreferredSize(GRAPH_PANEL_SIZE);
			graphPanel.setPreferredSize(GRAPH_PANEL_SIZE);
			graphPanel.setBackground(Color.GRAY);
			
		}
		return graphPanel;		
	}

}



